<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /**
       * @param {number} x
       * @return {boolean}
       */
      const isPalindrome = function (x) {
        if (x < 0 || !(x % 10 === 0 && x !== 0)) {
          return false;
        }
        // s 转 String 连续声明 rs 为string类型;
        let s = String(x),
          rs = "";
        // 反向 便利字符串吗，i = string.length -1; i >= 0; i--
        for (let i = s.length - 1; i >= 0; i--) {
          // 拼接字符串
          rs += s[i];
        }
        // return rs 与 s 的对比：
        return rs === s;
      };
    </script>
  </body>
</html>
